const express = require('express');
const router = require('./02-router')
const app = express();
const port = 8080;
const ip ='127.0.0.1';
app.listen(port,ip,()=>{
    console.log(`请登录 http://${ip}:${port}`)
})

// 注册静态文件中间键
app.use('/assets',express.static('assets'));
app.use('/uploads',express.static('uploads'));
app.use('/views',express.static('views'));

// 设置默认模板引擎
app.set('view engine','ejs')

// 注册router中间件
app.use(router);